Convert list to double[][] in C#3.0
Posted
by Newbie
on Stack Overflow
See other posts from Stack Overflow
or by Newbie
Published on 2010-05-06T10:32:56Z
Indexed on
2010/05/06
10:38 UTC
Read the original article
Hit count: 122
c#3.0
Given
List<double> x1 = new List<double> { -0.2718, -0.2240, -0.1275, -0.0810, 0.0349, -0.5067, 0.0094, -0.4404, -0.1212 };
List<double> x2 = new List<double> { 0.0330, -0.6463, 0.1226, -0.3304, 0.4764, -0.4159, 0.4209, -0.4070, -0.2090 };
How can I make as double[][] X at runtime(programatically).
I mean to say if the output I get if I run
double[][] X = { new double[]
{ -0.2718, -0.2240, -0.1275, -0.0810, 0.0349, -0.5067, 0.0094, -0.4404, -0.1212 },
new double[] { 0.0330, -0.6463, 0.1226, -0.3304, 0.4764, -0.4159, 0.4209, -0.4070, -0.2090 } };
Using C#3.0
Thanks
© Stack Overflow or respective owner